package com.letv.core.constant;

/**
 * 点播相关常量
 * 
 * @author zhuqiao
 *
 */

/**
 * 点播错误码新版本
 * 
 * @author 吴新荣
 * 2015-06-19
 */
public class PlayConstant {
    // -------------- 播放种类 --------------
    /**** 用于区分当前播放时点播还是直播 ****/
    public static final int PLAY_TYPE_ALBUM = 0;
    public static final int PLAY_TYPE_LIVE = 1;

    /**
     * 本地视频或4D
     */
    public static final int PLAY_DEFAULT = 0;
    /**
     * 播放专辑
     */
    public static final int PLAY_ALBUM = 1;
    /**
     * 不属于任何专辑的单视频
     */
    public static final int PLAY_VIDEO = 2;
    /**
     * 我的---本地缓存的视频
     */
    public static final int PLAY_DOWNLOAD = 3;

    public static final int PLAY_TOPIC_VIDEO = 11;
    public static final int PLAY_TOPIC_ALBUM = 12;

    // ------------回调广告---------------
    // 正片开始播放
    public static final int ON_VIDEO_START = 1;
    // 正片暂停
    public static final int ON_VIDEO_PAUSE = 2;
    // 正片继续
    public static final int ON_VIDEO_RESUME = 3;
    // 当视频播放完成
    public static final int ON_VIDEO_COMPLATE = 4;
    // 当视频播放错误
    public static final int ON_VIDEO_ERROR = 5;
    // 当播放区域发生改变
    public static final int ON_VIDEORE_SIZE = 6;
    // 当 Activity 暂停
    public static final int ON_ACTIVITY_PAUSE = 7;
    // 当 Activity 继续
    public static final int ON_ACTIVITY_RESUME = 8;
    // 当 Activity 退出
    public static final int ON_ACTIVITY_EXIT = 9;

    // -----------码流类型----------
    // 不支持码流切换
    public final static int STREAM_LEVEL_NO_NUM = 0;
    // 只支持流畅
    public final static int STREAM_LEVEL_LOW_NUM = 1;
    // 只支持高清
    public final static int STREAM_LEVEL_HD_NUM = 2;
    // 流畅、高清都支持
    public final static int STREAM_LEVEL_ALL_NUM = 3;

    // -------------- 打开方式(用来区别播放不同的视频) --------------
    public static final int LAUNCH_MODE_URI = 1;
    public static final int LAUNCH_MODE_ALBUM = 2;
    public static final int LAUNCH_MODE_VIDEO = 3;
    public static final int LAUNCH_MODE_DOWNLOAD = 4;
    // 轮播台
    public static final int LAUNCH_MODE_LIVE_LUNBO = 5;
    // 卫视台
    public static final int LAUNCH_MODE_LIVE_WEISHI = 6;
    // 直播厅
    public static final int LAUNCH_MODE_LIVE_SPORTS = 7;
    // 娱乐
    public static final int LAUNCH_MODE_LIVE_ENTERTAINMENT = 11;
    // 音乐
    public static final int LAUNCH_MODE_LIVE_MUSIC = 12;
    // 其他
    public static final int LAUNCH_MODE_LIVE_OTHER = 13;
    public static final int LAUNCH_MODE_H265_VIDEO = 9;
    public static final int LAUNCH_MODE_H265_ALBUM = 10;
    public static final int LAUNCH_MODE_TOPIC_VIDEO = 14;
    public static final int LAUNCH_MODE_TOPIC_ALBUM = 15;
    // 通过直播id播放
    public static final int LAUNCH_MODE_LIVE_ID = 16;
    public static final int LAUNCH_MODE_LIVE_SELECT_ID = 17;
    public static final int LAUNCH_MODE_LIVE_URL = 18; // int LAUNCH_MODE_LIVE_URL = 14;
    public static final int PLAY_MODE_SYSTEM = 1;
    public static final int PLAY_MODE_NATIVE = 2;
    public static final int PLAY_LIVE_REMEN = 25; // 热门首页
    public static final int PLAY_LIVE_URL = 26;

    // -------------- 播放来源 --------------
    public static final int LAUNCH_FROM_UNKONW = 0;
    public static final int LAUNCH_FROM_CHANNEL = 1;
    public static final int LAUNCH_FROM_HOME = 2;
    public static final int LAUNCH_FROM_MY = 3;
    public static final int LAUNCH_FROM_PLAYRECORD = 4;
    public static final int LAUNCH_FROM_RECOMMEND = 5;
    public static final int LAUNCH_FROM_FAVORITE = 6;
    public static final int LAUNCH_FROM_RELATED = 7;
    public static final int LAUNCH_FROM_RANKING = 8;
    public static final int LAUNCH_FROM_VCR = 9;
    public static final int LAUNCH_FROM_PAY = 10;
    public static final int LAUNCH_FROM_DOWNLOAD = 11;
    public static final int LAUNCH_FROM_SEARCH = 12;
    public static final int LAUNCH_FROM_PUSH = 13;
    public static final int LAUNCH_FROM_ATTENDANCE_WEB = 14;
    public static final int LAUNCH_FROM_TOPIC_PAGE = 15;
    public static final int LAUNCH_FROM_PLAY_PAGE = 16;
    public static final int LAUNCH_FROM_DOWNLOAD_WORLDCUP = 17;
    public static final int LAUNCH_FROM_LIVE_LUNBO = 18;
    public static final int LAUNCH_FROM_LIVE_REMEN = 19;
    public static final int LAUNCH_FROM_LIVE_ROOM_LUNBO = 22;
    /** 三方调起 */
    public static final int LAUNCH_FROM_MSITE = 20;
    /** 来自小窗 **/
    public static final int LAUNCH_FROM_PIPWINDOW = 21;
    /** 二维码扫描播放 **/
    public static final int LAUNCH_FROM_SCANQRCODE = 15;
    /** 从正片推荐跳转播放 **/
    public static final int LAUNCH_FROM_NORMAL_VIDEO_RECOMMEND = 23;

    // -------------- 直播频道 --------------
    public static final String CHANNEL_TYPE_KEY = "channel_type";
    public static final String CHANNEL_TYPE_VALUE_REMEN = "remen";
    public static final String CHANNEL_TYPE_VALUE_WEISHI = "weishi";
    public static final String CHANNEL_TYPE_VALUE_LUNBO = "lunbo";
    public static final String CHANNEL_TYPE_VALUE_ENT = "ent";
    public static final String CHANNEL_TYPE_VALUE_SPORTS = "sports";
    public static final String CHANNEL_TYPE_VALUE_MUSIC = "music";
    public static final String CHANNEL_TYPE_VALUE_OTHER = "other";

    // -------------- intent传参 --------------
    public static final String PLAY_TYPE = "playType"; // 判断直播点播
    public static final String LAUNCH_MODE = "launchMode";
    public static final String FROM = "from";
    public static final String CARD = "card";
    public static final String ROOM = "room";
    public static final String IS_ME = "is_me";
    public static final String IS_FROM_EDIT_SCREENROOM = "is_from_edit_screenroom";
    public static final String BACK = "back";
    public static final String HTIME = "htime";
    public static final String VIDEO_LIST = "videoList";
    public static final String RECOMMEND_INDEX = "recommendIndex";
    public static final String AID = "aid";
    public static final String VID = "vid";
    public static final String ZID = "zid";
    public static final String PID = "pid";
    public static final String TYPE = "type";
    public static final String PVID = "pvid";
    public static final String IS_DOLBY = "isDolby";
    public static final String SEEK = "seek";
    public static final String URI = "uri";
    public static final String PAGE_ID = "pageid";
    public static final String HAPT_URL = "haptUrl";
    public static final String PLAY_MODE = "playMode";
    public static final String REF = "ref";
    public static final String IS_FROM_PUSH = "isFromPush";
    public static final String IS_FULL_FIRST = "isFullFirst";
    public static final String IS_LOAD_DATA = "is_load_data";
    // 浮球位置pageIndex
    public static final String FLOATPAGEINDEX = "floatPageIndex";
    // 浮球pageid
    public static final String FLOATINDEX = "floatIndex";
    public static final String LIVE_LAUCH_METHOD = "launch_mothod";
    public static final String LIVE_CODE = "code";
    public static final String LIVE_URL = "url";
    public static final String LIVE_STREAMID = "streamId";
    // 码流
    public static final String LIVE_URL_350 = "url_350";
    public static final String LIVE_STREAMID_350 = "streamId_350";
    public static final String LIVE_URL_1000 = "url_1000";
    public static final String LIVE_STREAMID_1000 = "streamId_1000";
    public static final String LIVE_PROGRAM_NAME = "program_name";
    public static final String LIVE_CHANNEL_ID = "channel_id";
    public static final String LIVE_SOURCE_ID = "source_id";
    public static final String LIVE_CHANNEL_LUNBO_NUMBER = "channel_lunbo_num";
    public static final String LIVE_ENCRYPT = "encrypt_url";
    public static final String LIVE_MODE = "mode";
    public static final String LIVE_CHANNEL_NAME = "live_channel_name";
    public static final String LIVE_FULL_ONLY = "full";
    public static final String LIVE_IS_LOW = "islow";
    public static final String LIVE_DEFAULT_SHOW_DAY = "default_show_day";
    // 和直播id相同，只不过入口不同时，这个字段才有值。适用于只传来直播id的情况只进全屏，或者还传来频道类型，会进半屏的情况。
    public final static String LIVE_LAUNCH_ID = "channel_ename";
    public static final String LIVE_SELECT_ID = "select_id";
    public static final String LIVE_ID = "yc_id";
    // 付费参数集
    public static final String BUNDLE_KEY_YC_PARAM = "yc_param";
    // 付费直播
    public final static String LIVE_IS_PAY = "is_pay";
    // 场次
    public final static String LIVE_SCREENINGS = "screenings";
    // 主队icon url
    public final static String LIVE_HOME_ICON = "home_icon";
    // 客队icon url
    public final static String LIVE_GUEST_ICON = "guest_icon";
    // 开始播放时间
    public final static String LIVE_PLAY_TIME = "play_time";
    public final static String LIVE_PUSH_ENDTIME = "liveEndDate";
    public final static String LIVE_PUSH_CID = "cid";

    // -------------- requestcode --------------
    public static final int REQUESTCODE_PLAY = 100;
    public static final int LOGIN_REQUESTCODE = 0x10;
    public static final int PAY_REQUESTCODE = 0x11;
    public static final int REQUEST_CODE_LIVE_PAY_LOGIN = 0x12; // 鉴权登录的ReqeustCode
    public static final int REQUEST_CODE_LIVE_PAY_WEB = 0x13; // 付费直播跳转支付页面的requestCode
    public static final int RESULT_CODE_PAY_SUCCESS = 1999;
    public static final int RESULT_CODE_PAY_FAILED = 1998;

    public static final int FORPLAY = 1;
    public static final int FORTS = 2;

    // -------------- 播放器大小 --------------
//    public static final int HALF_VIDEO_HEIGHT = UIsUtils.getMinScreen() * 180 / 320;

    /**
     * 新版本的点播模块错误码
     * 说明: 注释类型为：错误原因 老版本的错误码
     */

    public static class PlayErrCode {
        /**
         * 版权限制
         * </br>
         * 老版本00014
         */
        public static final String COPYRIGHT_RESTRICTIONS = "00015";
        /**
         * 视频已下线
         * </br>
         * 老版本00010
         */
        public static final String VIDEO_OFFLINE = "0007";
        /**
         * 用户受限判断失败-未告诉国家ip
         * </br>
         * 老版本00602
         */
        public static final String USER_LIMITED_UNKONW_COUNTY = "0016";
        // CopyrigSecurityChainURLScheduling
        /**
         * 防盗链url调度
         * </br>
         * 老版本00608
         */
        public static final String SECURITY_CHAIN_URL_SCHEDULING = "0204";
        /**
         * 大陆IP受限
         */
        public static final String OVERSEA_IP_LIMITED_CN = "0012";
        /**
         * 海外IP受限 IP为香港
         * </br>
         * 老版本00011
         */
        public static final String OVERSEA_IP_LIMITED_HONGKONG = "0037";
        /**
         * 海外IP受限 IP为非大陆非香港
         * </br>
         * 老版本00011
         */
        public static final String OVERSEA_IP_LIMITED_NO_CHINA = "0008";
        /**
         * 获取地址/数据失败
         * </br>
         * 老版本00603
         */
        public static final String ADDRESS_OR_DATA_ACQUIRED_FAILED = "0017";
        /**
         * 缺少播放的必要的参数
         */
        public static final String PARAMS_ERROR = "1505";
        /**
         * （本地视频）视频播放失败
         * </br>
         * 老版本00607
         */
        public static final String LOCAL_VIDEO_FILE_PLAY_FAILED = "0020";
        /**
         * 当前码流不能正确播放
         * </br>
         * 老版本0407
         */
        public static final String CURRENT_CODE_STREAM_COULD_NOT_PLAY_CORRECT = "0407";
        /**
         * 从接口取到的播放的video model为空
         * </br>
         * 老版本00604
         */
        public static final String VIDEO_INFO_IS_NULL = "1506";
        /**
         * 下载视频文件失败(cde)
         * </br>
         * 老版本00605
         */
        public static final String DOWNLOAD_VIDEO_FILE_FAILED = "0018";

        // // 版权限制/视频已下线-老版本错误码00010
        // public static final String COPYRIGHT_RESTRICTIONS_OR_VIDEO_OFFLINE = "0007";
        // // 用户受限判断失败-老版本错误码00602
        // public static final String USER_LIMITED_JUDGE_FAILED = "0016";
        // // 防盗链url调度-老版本错误码00608
        // public static final String SECURITY_CHAIN_URL_SCHEDULING = "0204";
        // // 海外IP受限(IP为香港)-老版本错误码00011
        // public static final String OVERSEA_IP_LIMITED_HONGKONG = "0037";
        // // 海外IP受限(IP为非大陆非香港)-老版本错误码00011
        // public static final String OVERSEA_IP_LIMITED_NOT_MAINLAND_CHINA_AND_HONGKONG = "0008";
        // // 获取地址/数据失败-老版本错误码00603
        // public static final String ADDRESS_OR_DATA_ACQUIRED_FAILED = "0017";
        // /**
        // * 老版本错误码00604包含如下错误类型
        // */
        // // 热点频道需要付费试看
        // public static final String HOT_CHANNEL_TRY_AND_SEE_REQUIRE_PAY = "0029";
        // // 播放专题时取得的专题zid是空的
        // public static final String ACQUIRED_NULL_ZID_WHILE_PLAYING_TOPIC = "1502";
        // // 播放正常视频取不到vid
        // public static final String ACQUIRE_VID_FAILED_WHILE_PLAYING_VIDEO = "1503";
        // // 从接口取到的播放的video model为空
        // public static final String ACQUIRED_NULL_VIDEO_FROM_INTERFACE = "1506";
        // // 缺少请求视频文件时的必要的接口参数
        // public static final String MISSING_PARAMS_WHILE_REQUIRE_VIDEO_FILE = "1507";
        //
        // // 下载视频文件失败-老版本错误码00605
        // public static final String DOWNLOAD_VIDEO_FILE_FAILED = "0018";
        // // 解析url失败-老版本错误码00606
        // public static final String PARSE_URL_FAILED = "0019";
        // // 本地视频播放失败-老版本错误码00607
        // public static final String LOCAL_VIDEO_FILE_PLAY_FAILED = "0020";
        // // 当前码流不能正确播放-老版本错误码00999
        // public static final String CURRENT_CODE_STREAM_COULD_NOT_PLAY_CORRECT = "0407";
        //
        // // 视频详情接口错误-老版本错误码00301
        // public static final String INTERFACE_ERR_VIDEO_DETAIL = "0033";
        // // 专辑详情接口错误-老版本错误码00303
        // public static final String INTERFACE_ERR_TOPIC_DETAIL = "0034";
        // // 专辑视频列表接口错误-老版本错误码00304
        // public static final String INTERFACE_ERR_TOPIC_VIDEO_LIST = "0035";
        // // 视频文件接口错误-老版本错误码00302
        // public static final String INTERFACE_ERR_VIDEO_FILE = "0036";
        // // 付费信息接口错误-老版本错误码00305
        // public static final String INTERFACE_ERR_PAY_INFO = "1405";

    }

    /**
     * 鉴权
     * 
     * @author zhuqiao
     *
     */
    public static class Authentication {
        /**
         * 仅提示“使用网页观看”，不提供网页链接按钮
         */
        public static final String WEB = "WEB";
        /**
         * 提示“使用网页观看”且提供网页链接按钮
         */
        public static final String WEB_JUMP = "WEB_JUMP";
        /**
         * 提示“使用TV投屏观看”
         */
        public static final String TV_JUMP = "TV_JUMP";
        /**
         * 三端均无版权
         */
        public static final String NO_COPYRIGHT = "NO_COPYRIGHT";
    }

    /**
     * 直播类型
     */
    public interface LiveType {
        // 轮播和卫视台的处理逻辑一样
        int PLAY_LIVE_LUNBO = 5;
        int PLAY_LIVE_WEISHI = 6;
        int PLAY_LIVE_SPORTS = 7;
        int PLAY_LIVE_ENTERTAIN = 21;
        int PLAY_LIVE_MUSIC = 22;
        int PLAY_LIVE_OTHER = 23;
        int PLAY_LIVE_PUSH = 24;
    }

    /**
     * 
     * 直播名称
     */
    public interface LiveNames {

        String LIVE_SPORTS = "sports";

        String LIVE_ENT = "ent";

        String LIVE_MUSIC = "music";

        String LIVE_OTHER = "other";
    }

    // 声音状态
    public enum VOLUME_STATE {
        HIGH, MIDDLE, LOW, MUTE
    }

    /**
     * 直播付费
     */
    public interface LivePay {
        /**
         * 未登录 显示登录和订购button
         */
        int LIVE_PAY_NOT_LOGIN = 1001;
        /**
         * 已登录未订购，只显示订购button
         */
        int LIVE_PAY_LOGIN_UNORDER = 1002;
        /**
         * 已登录已定购未开始--提示开始时间 -- 提示直播券数量 -- 刷新页面
         */
        int LIVE_PAY_LOGIN_ORDER_UNSTART_UNUSE = 1003;
        /**
         * 已登录已定购未开始--提示开始时间 -- 提示可以直接观看 -- 刷新页面
         */
        int LIVE_PAY_LOGIN_ORDER_UNSTART_USED = 1004;
        /**
         * 已登录已开始，有券可用--提示将使用直播券--提示剩余券数量--立即观看
         */
        int LIVE_PAY_PLAY_NOW = 1005;
    }
}
